<!--
Author: Quan Van Sinh
Email : sinhvnb@vietnambiz.com
Mobile: 0972405165
-->
<?php include ADMIN_INCLUDE_DIR."/header.php";?>

<?php $rsNewsEdit = editUpdateNews();?>
<script language="javascript" type="text/javascript">
    
    function submitFormAddNews(submitType){
        if(submitType=='exit'){
            $("#submitType").val('exit');
            $("#submitFrmNewsAdd").click();
        }
    }
    
</script>
<div class="container_l">
    <form name="formNewsAddCategory" method="POST" action="">
        <div class="title_user"><img src="images/icon1.gif" />Quảng cáo</div>
        <div class="table_user">
            <div class="table_user_in2">
                <?php
                show_error();
                show_success();
                ?>
                <fieldset>
                    <legend accesskey="N">Cập nhật Quảng cáo</legend>
                    <div class="lineaddnew">
                        <div style="width:70%;float:left;">
                            <div class="lineform">
                                <div class="divlabel_news">Tiêu đề: <font color="#FF0000">*</font></div>
                                <div class="divform">
                                    <input type="text" name="title" value="<?php echo $rsNewsEdit['rsNewsEdit']['title'];?>" />
                                </div>
                            </div>

                            <div class="lineform">
                                <div class="divlabel_news">link: <font color="#FF0000">*</font></div>
                                <div class="divform">
                                    <input type="text" name="link" value="<?php echo $rsNewsEdit['rsNewsEdit']['link'];?>" />
                                </div>
                            </div>
                            <div class="lineform">
                                <div class="divlabel_news">Trang hiển thị: <font color="#FF0000">*</font></div>
                                <div class="divform" style="width: 80%">
                                    <?php
                                    $array_module = $CONFIG['client_modules_list'];
                                    $arr_permiss  = explode(',',$rsNewsEdit['rsNewsEdit']['module']);
                                    //print_r($arr_permiss);
                                    foreach ($array_module as $key=>$value) {
                                        $checked ="";
                                        if(in_array($key,$arr_permiss)) {
                                            $checked = "checked='checked'";
                                        }
                                        echo "<input type='checkbox' name='page[]' value='".$key."' ".$checked." style='width:3%; background:none; border:none;' />";
                                        echo "<font class='textbody'>".$array_module[$key]."</font>&nbsp;&nbsp;";
                                    }
                                    ?>

                                </div>
                            </div>
                            <div class="lineform">
                                <div class="divlabel_news">Vị trí hiển thị: <font color="#FF0000">*</font></div>
                                <div class="divform">
                                    <select name="position" style="width:72%;">
                                        <option <?php echo setSelectedBoxValue('left', $rsNewsEdit['rsNewsEdit']['position']);?> value="left">bên trái</option>
                                        <option <?php echo setSelectedBoxValue('right', $rsNewsEdit['rsNewsEdit']['position']);?> value="right">bên phải</option>
                                        <option <?php echo setSelectedBoxValue('bottom', $rsNewsEdit['rsNewsEdit']['position']);?> value="bottom">bên dưới</option>
                                    </select>
                                </div>
                            </div>
                            
                            <div class="lineform">
                                <div class="divlabel_news">Chủ sở hữu: </div>
                                <div class="divform">
                                    <input type="text" name="owner" value="<?php echo $rsNewsEdit['rsNewsEdit']['owner'];?>" />
                                </div>
                            </div>
                            <div class="lineform">
                                <div class="divlabel_news">Chi tiết: </div>
                                <div class="divform">
                                    <textarea name="description" rows="4" cols="20"><?php echo $rsNewsEdit['rsNewsEdit']['description'];?></textarea>
                                </div>
                            </div>
                            
                            
                        </div>
                    </div>
                    <div class="spacer1"><span></span></div>
                </fieldset>
                <div class="linesubmit">
                    <input type="hidden" name="submitType" id="submitType" value="">
                    <input type="submit" name="submitFrmNewsAdd" id="submitFrmNewsAdd" value="Lưu lại" class="button" />
                    <input type="button" name="submitFrmNewsAddAndExit" onclick="javascript:history.go(-1);" value="Thoát" class="button" />
                </div>
            </div>
        </div>
    </form>
</div>
<?php
include "inc/right.php";
include ADMIN_INCLUDE_DIR."/footer.php";
?>